package demo.hms.stay.service.servicelmpl;

import demo.hms.mybatis.entity.Live;
import demo.hms.mybatis.entity.Stay;
import demo.hms.stay.dao.StayDao;
import demo.hms.stay.service.StayService;
import demo.hms.util.Result;
import demo.hms.util.ResultSubmit;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.READ_COMMITTED,rollbackFor = Exception.class)
public class StayServicelmpl implements StayService {
    @Resource
    private StayDao dao;

    @Override
    public Result selectStay(Stay stay) {
        return ResultSubmit.success(dao.selectStay(stay));
    }

    @Override
    public Result insertStay(Live live) {
        return null;
    }

}
